﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第111题
//BC113 小乐乐定闹钟
//https://www.nowcoder.com/practice/0f7e422e12be4a7f9958ca2a82abc775?tpId=107&tqId=33394&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D3%26tpId%3D107%26type%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>

int main() {
    int hour = 0;
    int minute = 0;
    int k = 0;
    scanf("%d:%d %d", &hour, &minute, &k);
    //k大于六十分钟
    while (k > 60) {
        k -= 60;
        hour++;
        if (hour >= 24) {
            hour -= 24;
        }
    }
    minute += k;
    while (minute > 60) {
        minute -= 60;
        hour++;
        if (hour >= 24) {
            hour -= 24;
        }
    }

    printf("%#02d:%#02d", hour, minute);
    return 0;
}